﻿Module Module1

    Private server As New Server("192.168.1.81", "5005")

    Sub Main()
        Dim T As New Threading.Thread(AddressOf Start)
        T.Start()

        Dim msg As String = String.Empty

        While True

            msg = Console.ReadLine

            comandi(msg)

        End While

        Console.ReadKey()
        Console.ReadKey()
    End Sub

    Private Sub comandi(ByVal msg As String)

        Select Case msg.ToLower
            Case "scrivi"
                Console.WriteLine("Ciao belli")
            Case "senda"
                server.SendPackets(Console.ReadLine())
            Case "exit", "fine"
                End
            Case "start"
                Dim ni As New ConfigTools
            Case "prova"
                server.SendPackets("notepad")
        End Select

    End Sub

    Private Sub Start()
        If Tools.IpTools.VerifyIp(server.GetIp) Then
            Console.WriteLine("Ip Valido")
            server.startServer()
        Else
            Console.WriteLine("Ip Non Valido")
        End If
    End Sub

End Module
